<?php
require_once '../include/config.php';
require_once '../include/functions.php';
$cid = $_GET['Cid'];
$state = $_GET['state'];
$sql = "UPDATE tblcategory SET state = $state WHERE id = $cid ";
$result = mysql_query($sql);
?>
<body style="margin:0px;">
<center>
<?php
$sql1 = "SELECT state FROM tblcategory WHERE id = $cid";
$result1 = mysql_query($sql1);
$row1 = mysql_fetch_assoc($result1);
	if ($row1['state']==1)
	{
?>
<a href="?Cid=<?php echo $cid;?>&state=0"><img src="<?php echo WEB_ROOT; ?>images/public.jpg" border="0" /></a>
<?php
	}else
	{
	?>
<a href="?Cid=<?php echo $cid;?>&state=1"><img src="<?php echo WEB_ROOT; ?>images/unpublic.jpg" border="0" /></a>
    <?php
	}
	?>
    </center>
</body>